ImageGear Professional v18 for Mac
Rotating an Image

The Processing menu contains a group of Rotate 90 and Rotate Any items.

Using IG_IP_rotate_multiple_90(), you can rotate your image on 90, 180, or 270 degrees. The code sample below demonstrates a 90 degree rotation. The required angle of rotation should be specified by one of IG_ROTATE_ constants.

 
Copy Code

- (IBAction)mnuProcessingRotate90:(id)sender {
    if(IG_image_is_valid(hIGear))
    {
        IG_IP_rotate_multiple_90(hIGear, IG_ROTATE_90);
        // Update main view
        [mainScrollViewOutlet setNeedsDisplay:YES];
    }
}

Although the visible result of this function call is similar to that of IG_dspl_orientation_set() described in Image Orientation, the significant difference between them is that all functions of the ImageGear Image Processing group (IG_IP_ ) do change image's contents, while the ImageGear Image Display functions (IG_dspl_ ) do not.

IG_IP_rotate_any_angle() allows you to rotate an image to any angle. In the sample below, the image will be rotated 123.5 degrees.

 
Copy Code
- (IBAction)mnuProcessingRotateAny:(id)sender {
    if(IG_image_is_valid(hIGear))
    {
        IG_IP_rotate_any_angle(hIGear, 123.5, IG_ROTATE_CLIP);
        // Update main view
        [mainScrollViewOutlet setNeedsDisplay:YES];
    }
}

Below you can see the image that is rotated on 123.5 degrees:

 

 


©2016. Accusoft Corporation. All Rights Reserved.

Send Feedback